package com.soen341.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import com.soen341.model.enums.SemesterEnum;
 
//--------------------------------------------------------------------------------------------------------------------------------
/**
* Model class for Prerequisite
*/
//--------------------------------------------------------------------------------------------------------------------------------
@Entity
@Table(name = "sequenceMember")
@NamedQueries(
		{
			@NamedQuery(name = "getSequence",
			query = "SELECT s FROM SequenceMember s where s.sequenceId=:sequenceId")
		})
public class SequenceMember implements Serializable
{
	private static final long serialVersionUID = 1L;	// Default serial version ID

	@Id
	@Column(name="id")
	private Long id;

	@Column(name="sequenceId")
	private String sequenceId;

	// TODO: consider changing enum to simple int (1,2,3,4)
	@Column(name="semester")
	@Enumerated(EnumType.STRING)
	private SemesterEnum semester;

	// TODO: consider changing it to int level instead of courseYear
	@Column(name="courseYear")	// can be 1 (1st), 2 (2nd), 3 (third) or 4 (4th)
	private int courseYear;
	
	@Column(name="courseCode")
	private String courseCode;

	// --------------------------------------------------------------------------------------------------------------------------------
	/**
	 * 	Constructor.
	 */
	// --------------------------------------------------------------------------------------------------------------------------------
	public SequenceMember()
	{
	}

	// --------------------------------------------------------------------------------------------------------------------------------
	/**
	 * Setters and getters.
	 */
	// --------------------------------------------------------------------------------------------------------------------------------
	public Long getId()
	{
		return id;
	}
	// --------------------------------------------------------------------------------------------------------------------------------
	public void setId(Long id)
	{
		this.id = id;
	}


	// --------------------------------------------------------------------------------------------------------------------------------
	public String getSequenceId()
	{
		return sequenceId;
	}
	// --------------------------------------------------------------------------------------------------------------------------------
	public void setSequenceId(String code)
	{
		this.sequenceId = code;
	}


	// --------------------------------------------------------------------------------------------------------------------------------
	public SemesterEnum getSemester()
	{
		return semester;
	}
	// --------------------------------------------------------------------------------------------------------------------------------
	public void setSemester(SemesterEnum semester)
	{
		this.semester = semester;
	}


	// --------------------------------------------------------------------------------------------------------------------------------
	public int getCourseYear()
	{
		return courseYear;
	}
	// --------------------------------------------------------------------------------------------------------------------------------
	public void setCourseYear(int courseYear)
	{
		this.courseYear = courseYear;
	}


	// --------------------------------------------------------------------------------------------------------------------------------
	public String getCourseCode()
	{
		return courseCode;
	}
	// --------------------------------------------------------------------------------------------------------------------------------
	public void setCourseCode(String course)
	{
		this.courseCode = course;
	}
}